<template>
	<view>
		<view class="flex j-c a-c" style="height: 400rpx;width: 750rpx;">
			<view class=""> 
				<image src="../../static/icon/anquan.png" style="width: 150rpx;height: 150rpx;"></image>
				<view class="pt3">
					<text>安全等级：中</text>
				</view>
			</view>
		</view>
		<view class="p3">
			<text >通过以下设置可提高安全等级</text>
		</view>
		<view class="pb1 ">
			<view class="p3 flex a-c j-b" style="height: 120rpx;">
				<view class="flex a-c">
					<text class="bicon f40 ">&#xe67b;</text>
					<text class="f30 ml2 ">绑定手机管理</text>
				</view>
				<view class="" @click="on_bang()">
					<text class="f30"> {{user.tel? user.tel:'立即绑定' }} </text>
					<text class="f30 bicon">&#xe6a3;</text>
				</view>
			</view>

			<view @click="on_set_pwa" class="p3 flex a-c j-b" style="height: 120rpx;">
				<view class="flex a-c">
					<text class="bicon f40 ">&#xe6c0;</text>
					<text class="f30 ml2 ">设置修改密码</text>
				</view>
				<view class="">
					<text class="f30 bicon ">&#xe6a3;</text>
				</view>
			</view>
		</view>
		<view class="pb1 " @click="on_set_del">
			<view class="p3 flex a-c j-b" style="height: 120rpx;">
				<view class="flex a-c">
					<text class="bicon f40 ">&#xe663;</text>
					<text class="f30 ml2 ">注销账号</text>
				</view>
				<view class="">
					<text class="f30 bicon ">&#xe6a3;</text>
				</view>
			</view>
		</view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				user: {}
			}
		},
		onShow() {
			this.init();
		},
		onLoad() {
			this.token = uni.getStorageSync('token');
		},
		methods: {
			on_bang() {
				if (this.user.tel) {
					return
				}
				uni.navigateTo({
					url: '/pages/banmi/bind_tel?account=0' + '&nickname=' + this.user.nickname
				})
			},
			on_set_pwa() {
				var that = this;
				if (!this.user.tel) {
					uni.showModal({
						title: '提示',
						content: '请先绑定手机号',
						success: function(res) {
							if (res.confirm) {
								that.on_bang();
							}
						}
					});
					return
				}
				uni.navigateTo({
					url: '/pages/banmi/user_set_pwa'
				})
			},
			init() {

				this.Banmikeji.user_info().then(ret => {
					if (ret != 0) {
						this.user = ret.data.user; 
						return
					}
				})

			},
			on_set_del() {
				uni.navigateTo({
					url: '/pages/banmi/user_delete'
				})
			},
		}
	}
</script>

<style>
 
</style>